Skip to content

Add an example for encrypting payloads.#82

Merged
robholland merged 6 commits intotemporalio:masterfrom
robholland:rh-encrypted-payloads-sample
Apr 14, 2021
Merged

Add an example for encrypting payloads.#82
robholland merged 6 commits intotemporalio:masterfrom
robholland:rh-encrypted-payloads-sample

Conversation

@robholland
Copy link
Copy Markdown
Contributor

No description provided.

@robholland robholland requested a review from vitarb March 18, 2021 11:12
@robholland robholland requested a review from mfateev March 18, 2021 16:58
Comment thread src/main/java/io/temporal/samples/encryptedpayloads/CryptDataConverter.java Outdated
Comment thread src/main/java/io/temporal/samples/encryptedpayloads/CryptDataConverter.java Outdated
}

@Override
public Optional<Payloads> toPayloads(Object... values) throws DataConverterException {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would call converter.toPayloads(values) and then serialize the resulting Payload (using protobuf generated method) and then encrypt the whole thing at once.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This didn't quite feel safe to me as Payloads has no metadata. I have however taken the suggestion of encrypting/decrypting the serialised payload rather than encrypting only the data. This is much cleaner now :)

@robholland robholland requested a review from mfateev April 12, 2021 13:53
This allows key rotation to be used.
@robholland robholland merged commit 140f411 into temporalio:master Apr 14, 2021
@robholland robholland deleted the rh-encrypted-payloads-sample branch April 14, 2021 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants